package com.linkage.educloud.ah.view.activity.mine;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.linkage.educloud.ah.R;
import com.linkage.educloud.ah.adapter.WatchedAdapter;
import com.linkage.educloud.ah.bean.AccountData;
import com.linkage.educloud.ah.config.AccountConfig;
import com.linkage.educloud.ah.mvp.contract.mine.IMyBagContract;
import com.linkage.educloud.ah.mvp.presenter.mine.MyBagPresenter;
import com.linkage.educloud.ah.view.BasicTitleActivity;
import com.linkage.educloud.ah.widget.MyMore;
import com.linkage.educloud.ah.widget.NoScrollGridView;
import com.zzhou.common.library.util.ToastShow;

import butterknife.BindView;

/**
 * Created by Mr'Tang on 2018/12/12.
 */

public class MyBagActivity extends BasicTitleActivity implements View.OnClickListener {

    @BindView(R.id.ac_mybag_name)
    TextView ac_mybag_name;
    @BindView(R.id.ac_mybag_tel)
    TextView ac_mybag_tel;
    @BindView(R.id.ac_mybag_had_bug)
    ImageView ac_mybag_had_bug;
    @BindView(R.id.ac_mybag_waitfor_bug)
    ImageView ac_mybag_waitfor_bug;
    @BindView(R.id.ac_mybag_my_note)
    ImageView ac_mybag_my_note;
    @BindView(R.id.ac_mybag_my_collection)
    ImageView ac_mybag_my_collection;
    @BindView(R.id.ac_mybag_more)
    MyMore ac_mybag_more;
    @BindView(R.id.ac_mybag_my_gridview)
    NoScrollGridView ac_mybag_my_gridview;

    AccountData accountData;

    public static void launch(Context context) {
        Intent intent = new Intent(context, MyBagActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_mybag;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        accountData = AccountConfig.getLoginAccount();
        ac_mybag_name.setText(accountData.getUserName());
        if (accountData.getUserType() == 3) {
            ac_mybag_tel.setText(accountData.getPhone());
        }
        ac_mybag_had_bug.setOnClickListener(this);
        ac_mybag_waitfor_bug.setOnClickListener(this);
        ac_mybag_my_note.setOnClickListener(this);
        ac_mybag_my_collection.setOnClickListener(this);
        ac_mybag_more.setOnClickListener(this);

        ToastShow.show(this, "观看过的资源数据库待添加中");
//        WatchedAdapter adapter = new WatchedAdapter(this, null);
//        ac_mybag_my_gridview.setAdapter(adapter);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ac_mybag_had_bug:

                break;
            case R.id.ac_mybag_waitfor_bug:

                break;
            case R.id.ac_mybag_my_note:

                break;
            case R.id.ac_mybag_my_collection:

                break;
            case R.id.ac_mybag_more:

                break;
        }
    }
}
